<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> {$setting.webname}- 回收站</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/public/static/favicon.ico"> <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/footable/footable.core.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">


</head>

<body class="gray-bg">
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2>回收站</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:url('Admins/admin')}">主页</a>
            </li>
            <li>
                <strong>回收站</strong>
            </li>
        </ol>
    </div>
    <div class="col-sm-8" style="text-align: right;line-height: 15px;margin-top:25px;">

    </div>
</div>
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
        <div class="col-sm-12">
            <form action="" id="form1">
                <div class="row" style="margin-bottom: 20px">
                    <div class="col-sm-1">
                        <input type="text" placeholder="姓名" name="name" id="name" class="input form-control">
                    </div>
                    <div class="col-sm-1">
                        <select name="sex" id="sex" class="form-control">
                            <option value="" readonly selected>性别</option>
                            <option value="1">男</option>
                            <option value="0">女</option>
                        </select>
                    </div>
                    <div class="col-sm-1">
                        <select name="nation" id="nation" class="form-control">
                            <option value="">民族</option>
                            {foreach $nation as $val}
                            <option value="{$val.name}">{$val.name}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="col-sm-1">
                        <select name="grade" id="grade" class="form-control">
                            <option value="" readonly selected>年级</option>
                        </select>
                    </div>
                    <div class="col-sm-2">
                        <input type="text" placeholder="本人手机号" name="phone" id="phone" class="input form-control">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" placeholder="父母电话" name="parenttel" id="parenttel" class="input form-control">
                    </div>

                    <div class="col-sm-3">
                        <input type="text" placeholder="身份证号" name="idcards" id="idcards" class="input form-control">
                    </div>
                </div>
                <div class="row" style="margin-bottom: 20px">
                    <div class="col-sm-3">
                        <input type="text" name="schoolname" placeholder="学校名称" id="schoolname" class="input form-control">
                    </div>

                    <div class="col-sm-3">
                        <input type="text" placeholder="负责老师" name="teacher" id="teacher1" class="input form-control">
                    </div>
                    <div class="col-sm-2">
                        <input type="text" name="comment" placeholder="备注信息"  class="input form-control">
                    </div>
                    <div class="col-sm-2">
                        <button type="button" class="btn btn btn-info" style="width: 100%" id="search"> <i class="fa fa-search"></i> 综合搜索</button>
                    </div>
                    <div class="col-sm-2">
                        <button type="button" class="btn btn btn-danger" style="width: 100%" id="empty">清空回收站</button>
                    </div>
                </div>
            </form>
        <div class="tabs-container">
            <div class="tab-content">
                <!--新闻列表开始-->
                <div class="table-responsive">
                    <table class="footable table table-stripped toggle-arrow-tiny table-hover" data-page-size="15">
                        <thead>
                        <tr>
                            <th data-toggle="true">回收站编号</th>
                            <th>姓名</th>
                            <th>年级</th>
                            <th>电话</th>
                            <th>性别</th>
                            <th>父母电话</th>
                            <th>报考类别</th>
                            <th>专业大类</th>
                            <th>专业1</th>
                            <th>专业2</th>
                            <th>服从调剂</th>
                            <th>负责老师</th>
                            <th>回收时间</th>
                            <th>删除备注</th>
                            <th>操作</th>
                            <th data-hide="all">民族</th>
                            <th data-hide="all">qq/微信</th>
                            <th data-hide="all">毕业学校所在地</th>
                            <th data-hide="all">学校名称</th>
                            <th data-hide="all">中考（模拟）成绩</th>
                            <th data-hide="all">身份证号</th>
                            <th data-hide="all">学生备注</th>
                            <th data-hide="all">通讯地址</th>
                            <th data-hide="all">注册时间</th>
                            <th data-hide="all">注册后修改信息时间</th>
                            <th data-hide="all">报名状态</th>
                            <th data-hide="all">报名时间</th>
                            <th data-hide="all">报名修改时间</th>
                            <th data-hide="all">支付类型</th>
                            <th data-hide="all">支付账号（名称）</th>
                            <th data-hide="all">订单类型</th>
                            <th data-hide="all">支付时间</th>
                            <th data-hide="all">报名信息审核老师备注</th>
                        </tr>
                        </thead>
                        <tbody id="datas">

                        </tbody>
                    </table>
                </div>
                <!-- 列表结束 -->
                <tfoot>
                <tr>
                    <td colspan="9">
                        <ul class="pagination pull-left"></ul>
                    </td>
                </tr>
                </tfoot>
            </div>
        </div>
    </div>
</div>

</div>

<!--弹出层-->
<!-- 全局js -->
<script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>

<!-- iCheck -->
<script src="/public/static/admin/js/plugins/iCheck/icheck.min.js"></script>
<!-- Switchery -->
<script src="/public/static/admin/js/plugins/switchery/switchery.js"></script>

<!-- 自定义js -->
<script src="/public/static/admin/js/content.js?v=1.0.0"></script>
<script src="/public/static/admin/layui/layui.js"></script>
<script src="/public/static/admin/js/plugins/footable/footable.all.min.js"></script>
<script src="/public/static/admin/js/jquery.jqprint-0.3.js"></script>
<script>
    $(document).ready(function() {
        $('.footable').footable();
        $(".tabs").attr("class","tab-pane");
    });
    var dateyear = new Date().getFullYear();
    for(i=dateyear;i>=dateyear-10;i--) {
        $("#grade").append($("<option value="+i+">"+i+"</option>"));
    }
    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        //删除
        $("#datas").on("click",".del",function(){
            var s = $(this);
            top.layer.msg('你确定要永久删除"'+s.data('name')+'"吗？', {
                time: 20000, //20s后自动关闭
                shade: 0.8,
                btn: ['确定', '取消'],
                btn1:function(){
                    $.post("{:url('Dustbins/deletes')}",{id:s.attr('data-id')},function(data){
                        top.layer.closeAll();
                        top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                            $("#search").click();
                        });
                    });
                }
            });
        });
        //查询内容
        $("#search").on("click",function(){
            var form = $("#form1").serializeArray()
            var data = {}
            form.forEach((_this)=>{
                data[_this.name] = _this.value;
            })
            $.post("{:url('Dustbins/toSearch')}", data ,function(data){
                if(data.code){
                    $("#datas").html(data.msg).trigger('footable_redraw');
                }else{
                    top.layer.closeAll();
                    top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                        if(data.url){
                            window.location.href = data.url;
                        }
                    });
                }
            });
        });
        $("#search").click();

        console.log($(".refresh"));
        //恢复数据
        $("#datas").on("click",".refresh",function(){
            var name = $(this).data("name");
            var id = $(this).data("id");
            top.layer.msg("你确定要恢复\""+name+"\"的数据吗？",{
                time:10000,
                shade:0.5,
                btn:['确定','取消'],
                yes:function(){
                    $.post("{:url('Dustbins/refresh')}",{'id':id},function(data){
                        top.layer.closeAll();
                        top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                            if(data.url){
                                window.location.href = data.url;
                            }
                        });
                    })
                }
            })
        })

        //清空回收站
        $("#empty").on("click",function(){
            top.layer.msg("清空回收站将无法恢复，您确定要这么做吗？",{
                time:5000,
                shade:0.5,
                btn:['确定','取消'],
                yes:function(){
                  $.post("{:url('Dustbins/empty_dustbin')}",{},function(data){
                      top.layer.closeAll();
                      top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                          if(data.url){
                              window.location.href = data.url;
                          }
                      });
                  })
                }
            })
        })

    });

</script>




</body>

</html>
